package com.yp.controller;

import java.io.IOException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yp.pojo.Base;
import com.yp.service.JobService;

@Controller
@RequestMapping("/echarts")
public class JobController {

	@Autowired
	private JobService jobService;

	// [pic1] title-avg_money
	@RequestMapping("/site_num")
	@ResponseBody
	public List<Base> pic_1() throws IOException {
		List<Base> data = jobService.getAllTitleAndMoney();
		return data;
	}

	// [pic2]title-peoples
	@RequestMapping("/site_salary")
	@ResponseBody
	public List<Base> pic_2() throws IOException {
		List<Base> data = jobService.getAllTitleAndPeoples();
		return data;
	}

	// [pic3]edu-num
	@RequestMapping("/site_education")
	@ResponseBody
	public List<Base> pic_3() throws IOException {
		List<Base> data = jobService.getAllEduAndNum();
		return data;
	}

	// [pic4_1]exps
	@RequestMapping("/site_require1")
	@ResponseBody
	public List<String> pic_4_1() throws IOException {
		List<String> data = jobService.getAllExps();
		return data;
	}

	// [pic4_2]expsnums
	@RequestMapping("/site_require2")
	@ResponseBody
	public List<String> pic_4_2() throws IOException {
		List<String> data = jobService.getAllExpsNums();
		return data;
	}

	// [pic5]comp-num
	@RequestMapping("/site_company_num")
	@ResponseBody
	public List<Base> pic_5() throws IOException {
		List<Base> data = jobService.getAllCompAndNum();
		return data;
	}
}
